package com.lemurian.entity;

import java.io.Serializable;
import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Inheritance;
import javax.persistence.InheritanceType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

import org.hibernate.annotations.BatchSize;
import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;

import com.lemurian.entity.utils.DefaultPersistence;

@Entity
@Table(name="tb_management")
@Inheritance(strategy=InheritanceType.SINGLE_TABLE)
@BatchSize(size=1000)
@Cache(usage=CacheConcurrencyStrategy.READ_WRITE)
public class Management extends DefaultPersistence implements Serializable {

	private static final long serialVersionUID = 1L;

	@ManyToOne
	@JoinColumn(name="bpn_reqion_id")
	private BPNRegionList bpnRegion;
	
	@ManyToOne
	@JoinColumn(name="client_id")
	private Client client;
	
	@ManyToOne
	@JoinColumn(name="courier_id")
	private Courier courier;
	
	@ManyToOne
	@JoinColumn(name="occasions_code_id")
	private Category occasionsCode;
	
	@ManyToOne
	@JoinColumn(name="management_type_id")
	private Category managementType;
	
	private String process;
	private Date inBPNDate;
	private Date outBPNDate;
	private Date sendDate;
	private String note;
	
	public BPNRegionList getBpnRegion() {
		return bpnRegion;
	}
	
	public void setBpnRegion(BPNRegionList bpnRegion) {
		this.bpnRegion = bpnRegion;
	}

	public Client getClient() {
		return client;
	}

	public void setClient(Client client) {
		this.client = client;
	}

	public Courier getCourier() {
		return courier;
	}

	public void setCourier(Courier courier) {
		this.courier = courier;
	}

	@Column(name="process", length=45)
	public String getProcess() {
		return process;
	}

	public void setProcess(String process) {
		this.process = process;
	}

	@Temporal(TemporalType.DATE)
	@JoinColumn(name="in_bpn_date")
	public Date getInBPNDate() {
		return inBPNDate;
	}

	public void setInBPNDate(Date inBPNDate) {
		this.inBPNDate = inBPNDate;
	}

	@Temporal(TemporalType.DATE)
	@JoinColumn(name="out_bpn_date")
	public Date getOutBPNDate() {
		return outBPNDate;
	}

	public void setOutBPNDate(Date outBPNDate) {
		this.outBPNDate = outBPNDate;
	}

	@Column(name="note", length=1024)
	public String getNote() {
		return note;
	}

	public void setNote(String note) {
		this.note = note;
	}

	public Category getOccasionsCode() {
		return occasionsCode;
	}

	public void setOccasionsCode(Category occasionsCode) {
		this.occasionsCode = occasionsCode;
	}

	@Temporal(TemporalType.DATE)
	@JoinColumn(name="send_date")
	public Date getSendDate() {
		return sendDate;
	}

	public void setSendDate(Date sendDate) {
		this.sendDate = sendDate;
	}
	
	public Category getManagementType() {
		return managementType;
	}

	public void setManagementType(Category managementType) {
		this.managementType = managementType;
	}
}
